<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 订单操作记录 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\OrderAction.name", default="fa_order_action"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\OrderAction.poolName"))
 * @DDL(sql="CREATE TABLE `fa_order_action` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '操作记录 id',
  `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单 id',
  `order_item_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单商品id',
  `oper_type` enum('user','store','admin','system') NOT NULL COMMENT '操作人类型',
  `oper_id` int(11) NOT NULL DEFAULT '0' COMMENT '操作人 id',
  `order_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '订单状态',
  `dispatch_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '发货状态',
  `comment_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '评论状态',
  `aftersale_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '售后状态',
  `refund_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '退款状态',
  `remark` varchar(255) DEFAULT NULL COMMENT '操作备注',
  `createtime` int(11) DEFAULT NULL COMMENT '操作时间',
  `updatetime` int(11) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单操作记录'", decode="")
 *
 * @property int|null $id 操作记录 id
 * @property int|null $orderId 订单 id
 * @property int|null $orderItemId 订单商品id
 * @property string|null $operType 操作人类型
 * @property int|null $operId 操作人 id
 * @property int|null $orderStatus 订单状态
 * @property int|null $dispatchStatus 发货状态
 * @property int|null $commentStatus 评论状态
 * @property int|null $aftersaleStatus 售后状态
 * @property int|null $refundStatus 退款状态
 * @property string|null $remark 操作备注
 * @property int|null $createtime 操作时间
 * @property int|null $updatetime 更新时间
 */
abstract class OrderActionBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * 操作记录 id.
     * id
     * @Column(name="id", type="int", length=11, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id - 操作记录 id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id - 操作记录 id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 订单 id.
     * order_id
     * @Column(name="order_id", type="int", length=11, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $orderId = 0;

    /**
     * 获取 orderId - 订单 id.
     *
     * @return int|null
     */
    public function getOrderId(): ?int
    {
        return $this->orderId;
    }

    /**
     * 赋值 orderId - 订单 id.
     * @param int|null $orderId order_id
     * @return static
     */
    public function setOrderId($orderId)
    {
        $this->orderId = null === $orderId ? null : (int)$orderId;
        return $this;
    }

    /**
     * 订单商品id.
     * order_item_id
     * @Column(name="order_item_id", type="int", length=11, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $orderItemId = 0;

    /**
     * 获取 orderItemId - 订单商品id.
     *
     * @return int|null
     */
    public function getOrderItemId(): ?int
    {
        return $this->orderItemId;
    }

    /**
     * 赋值 orderItemId - 订单商品id.
     * @param int|null $orderItemId order_item_id
     * @return static
     */
    public function setOrderItemId($orderItemId)
    {
        $this->orderItemId = null === $orderItemId ? null : (int)$orderItemId;
        return $this;
    }

    /**
     * 操作人类型.
     * oper_type
     * @Column(name="oper_type", type="enum", length=0, accuracy=0, nullable=false, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $operType = NULL;

    /**
     * 获取 operType - 操作人类型.
     *
     * @return string|null
     */
    public function getOperType(): ?string
    {
        return $this->operType;
    }

    /**
     * 赋值 operType - 操作人类型.
     * @param string|null $operType oper_type
     * @return static
     */
    public function setOperType($operType)
    {
        $this->operType = null === $operType ? null : (string)$operType;
        return $this;
    }

    /**
     * 操作人 id.
     * oper_id
     * @Column(name="oper_id", type="int", length=11, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $operId = 0;

    /**
     * 获取 operId - 操作人 id.
     *
     * @return int|null
     */
    public function getOperId(): ?int
    {
        return $this->operId;
    }

    /**
     * 赋值 operId - 操作人 id.
     * @param int|null $operId oper_id
     * @return static
     */
    public function setOperId($operId)
    {
        $this->operId = null === $operId ? null : (int)$operId;
        return $this;
    }

    /**
     * 订单状态.
     * order_status
     * @Column(name="order_status", type="tinyint", length=2, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $orderStatus = 0;

    /**
     * 获取 orderStatus - 订单状态.
     *
     * @return int|null
     */
    public function getOrderStatus(): ?int
    {
        return $this->orderStatus;
    }

    /**
     * 赋值 orderStatus - 订单状态.
     * @param int|null $orderStatus order_status
     * @return static
     */
    public function setOrderStatus($orderStatus)
    {
        $this->orderStatus = null === $orderStatus ? null : (int)$orderStatus;
        return $this;
    }

    /**
     * 发货状态.
     * dispatch_status
     * @Column(name="dispatch_status", type="tinyint", length=2, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $dispatchStatus = 0;

    /**
     * 获取 dispatchStatus - 发货状态.
     *
     * @return int|null
     */
    public function getDispatchStatus(): ?int
    {
        return $this->dispatchStatus;
    }

    /**
     * 赋值 dispatchStatus - 发货状态.
     * @param int|null $dispatchStatus dispatch_status
     * @return static
     */
    public function setDispatchStatus($dispatchStatus)
    {
        $this->dispatchStatus = null === $dispatchStatus ? null : (int)$dispatchStatus;
        return $this;
    }

    /**
     * 评论状态.
     * comment_status
     * @Column(name="comment_status", type="tinyint", length=2, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $commentStatus = 0;

    /**
     * 获取 commentStatus - 评论状态.
     *
     * @return int|null
     */
    public function getCommentStatus(): ?int
    {
        return $this->commentStatus;
    }

    /**
     * 赋值 commentStatus - 评论状态.
     * @param int|null $commentStatus comment_status
     * @return static
     */
    public function setCommentStatus($commentStatus)
    {
        $this->commentStatus = null === $commentStatus ? null : (int)$commentStatus;
        return $this;
    }

    /**
     * 售后状态.
     * aftersale_status
     * @Column(name="aftersale_status", type="tinyint", length=2, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $aftersaleStatus = 0;

    /**
     * 获取 aftersaleStatus - 售后状态.
     *
     * @return int|null
     */
    public function getAftersaleStatus(): ?int
    {
        return $this->aftersaleStatus;
    }

    /**
     * 赋值 aftersaleStatus - 售后状态.
     * @param int|null $aftersaleStatus aftersale_status
     * @return static
     */
    public function setAftersaleStatus($aftersaleStatus)
    {
        $this->aftersaleStatus = null === $aftersaleStatus ? null : (int)$aftersaleStatus;
        return $this;
    }

    /**
     * 退款状态.
     * refund_status
     * @Column(name="refund_status", type="tinyint", length=4, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $refundStatus = 0;

    /**
     * 获取 refundStatus - 退款状态.
     *
     * @return int|null
     */
    public function getRefundStatus(): ?int
    {
        return $this->refundStatus;
    }

    /**
     * 赋值 refundStatus - 退款状态.
     * @param int|null $refundStatus refund_status
     * @return static
     */
    public function setRefundStatus($refundStatus)
    {
        $this->refundStatus = null === $refundStatus ? null : (int)$refundStatus;
        return $this;
    }

    /**
     * 操作备注.
     * remark
     * @Column(name="remark", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $remark = NULL;

    /**
     * 获取 remark - 操作备注.
     *
     * @return string|null
     */
    public function getRemark(): ?string
    {
        return $this->remark;
    }

    /**
     * 赋值 remark - 操作备注.
     * @param string|null $remark remark
     * @return static
     */
    public function setRemark($remark)
    {
        $this->remark = null === $remark ? null : (string)$remark;
        return $this;
    }

    /**
     * 操作时间.
     * createtime
     * @Column(name="createtime", type="int", length=11, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $createtime = NULL;

    /**
     * 获取 createtime - 操作时间.
     *
     * @return int|null
     */
    public function getCreatetime(): ?int
    {
        return $this->createtime;
    }

    /**
     * 赋值 createtime - 操作时间.
     * @param int|null $createtime createtime
     * @return static
     */
    public function setCreatetime($createtime)
    {
        $this->createtime = null === $createtime ? null : (int)$createtime;
        return $this;
    }

    /**
     * 更新时间.
     * updatetime
     * @Column(name="updatetime", type="int", length=11, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $updatetime = NULL;

    /**
     * 获取 updatetime - 更新时间.
     *
     * @return int|null
     */
    public function getUpdatetime(): ?int
    {
        return $this->updatetime;
    }

    /**
     * 赋值 updatetime - 更新时间.
     * @param int|null $updatetime updatetime
     * @return static
     */
    public function setUpdatetime($updatetime)
    {
        $this->updatetime = null === $updatetime ? null : (int)$updatetime;
        return $this;
    }

}
